#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <malloc.h>

typedef struct{
	char str[50]; //单词最大长度设为50
	int cnt;//单词出现次数
}Str;



int main() {
    char *dots = ",:;!.";//需要替换的标点符号
    
    
	char tmp[50]; 
	FILE *fp;
	Str words[400]; //单词数量上限 
	int num=0;//实际单词数量 
	int i,j,neww=1;//neww标志位，判断是否为新单词 

	fp = fopen("demo.txt", "r");
	//fscanf从文件中获取单个字符串 
	while ( fscanf(fp,"%s",tmp)!=EOF ) {
       for (int m = 0; m < strlen(dots); m++) {
           int k = 0;
           while(tmp[k] != '\0')
            {
                if(tmp[k] == dots[m])
                {
                    tmp[k] = *"";
                }
                if(tmp[k] == *"　")
                {
                    tmp[k] = *"";
                }
                k++;
            }
        }
		neww=1;
		for (i=0; i<num; i++) {
			//重复的单词 
			if ( strcmp(tmp, words[i].str)==0 ) {
				neww=0;
				words[i].cnt++;
			}
		}
		if (neww){
			// 复制字符串
			for (j=0; tmp[j]!='\0'; j++) {
				words[num].str[j] = tmp[j];
			}
			//单词末尾添加结束符 
			words[num].str[j] = '\0';
			// 新单词数量+1 
			words[num].cnt = 1;
            num++;
		}
	}
	printf("一共%d个不同的单词，每个单词出现次数如下：\n",num-1);
	for (i=num-1; i>=0; i--) {
		printf("%-10s %2d\n", words[i].str, words[i].cnt);
	}
	fclose(fp);
	return 0;
}




On a special day, our school held the first track and field meet at temple hill the Great Wall school. All the students were happily waiting for the games to be held.

　　Our class is the flower team of this sports meet. Early in the morning, everyone is wearing a white T-shirt. Although it is very cold, it will never erase our excitement. We began to walk around the playground from the entrance, and we were very excited along the way.

　　What impressed me most in the sports meeting was my long jump project. That morning I watched one exciting game after another. Xiao Fen, our classmate, took part in the long distance race and was able to take part in the final. Everyone cheered for her, she is running on the track, it is really not easy! The small Finn triumph, a tribute to her gaze, YiGouGou words of encouragement to me in my heart silently Fantasy: I'll jump the afternoon, really hope can be like a small Finnish students however.

　　In the afternoon, because of some special reasons, I pushed the game out to my teacher. In fact, I really want to win glory for the class. I want to play myself on the field, too, but, alas!

　　The teacher found Xiao Qin classmate instead of me. While she was in the long jump, I was watching. Xiaoqin students to show their style, jumped a long way. At that time my heart was happy and ashamed. Happy is that she won an honor for our class; ashamed that I even can not participate in the game, not to mention the class points, and even participated in the game, I also don't like Xiaoqin classmates do good results. In a word, the more I think about it, the more I reproach myself.

　　Sitting in the noisy auditorium, envy their excellent sports performance. Why is my sport so bad? Why can't I surpass other people on the playground like they do, but I suddenly think of my own advantages in learning. Chinese writing and reading comprehension ability is very strong, the last race I was Chinese first class! My English pronunciation is very standard, the usual exam is also good may be an excuse for my comfort! But I know people, there is a saying that each one has his good points! Well, a director of the foot, inch has been short.

　　A small thing at the Games gave me a reason.
